Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add length check (seting it) for sequences #1116

Closed
wants to merge 1 commit into from

Conversation

p-snft
Copy link
Member

@p-snft p-snft commented Aug 26, 2024

The test of the 0th element of a sequence being None is replaced by a test function that also sets the length of _FakeSequence objects, making them iterable afterwards. This is replacing the old hidden magic of setting the size on read access (from solph v0.5.3) by explicit write access at the same points in the code. (Just once in the beginning instead of multiple times on each access.)

Fixes #1115

For now, sequences that are too long are allowed.
We might want to warn in these cases.
@p-snft p-snft linked an issue Aug 26, 2024 that may be closed by this pull request
@p-snft
Copy link
Member Author

p-snft commented Aug 26, 2024

Note that this fix branch is branched from dev. We probably should have the fix in a v0.5 release.

@p-snft p-snft closed this Aug 26, 2024
@p-snft p-snft deleted the fix/fakesequences-not-iterating-correctly branch September 2, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FakeSequences Not Iterating Correctly
1 participant